package bold.deposit.useful;

import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropUtil {
    private static Properties config;

    static {
        try {
            config = PropertiesLoaderUtils.loadAllProperties("prop.properties");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws IOException {
        Properties properties = PropUtil.config;
     /*   System.out.println(properties.getProperty("key1"));
        System.out.println(properties.getProperty("key1"));*/


        InputStream stream = PropUtil.class.getClassLoader().getResourceAsStream("prop.properties");
        Properties p = new Properties();
        p.load(stream);

        InputStream stream1 = PropUtil.class.getClassLoader().getResourceAsStream("prop.properties");
        Properties p1 = new Properties();
        p1.load(stream1);

    }

}
